package com.cmnit.analysis.application

import java.util.Date

import com.cmnit.analysis.common.TApplication
import com.cmnit.analysis.controller.{BroadcastController, TrafficInsideController}
import com.cmnit.analysis.util.ServiceUtil
import org.apache.log4j.Logger

object TrafficInsideApplication extends TApplication {
  val logger: Logger = Logger.getLogger(this.getClass)
  private val broadcastController = new BroadcastController
  private val trafficInside = new TrafficInsideController

  def run(acctTime: String): Unit = {
    start("TrafficInside") {
      broadcastController.stationInfoBroadcast()
      broadcastController.gantryInfoBroadcast()

      if (acctTime.isEmpty)
        trafficInside.controller(ServiceUtil.getLastDayAcctDate(new Date))
      else
        trafficInside.controller(acctTime)
    }
  }
}
